<template>
  <div class="params">

    <div class="nav">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/params' }">规格参数</el-breadcrumb-item>
        <el-breadcrumb-item>规格包装</el-breadcrumb-item>
      </el-breadcrumb>
    </div>

    <div class="header">
      <el-input v-model="search"></el-input>
      <el-button type="primary">查看</el-button>
      <el-button type="primary" @click="showParams">添加</el-button>
    </div>


    <el-table :data="tableData" class="my-table">
      <el-table-column prop="date" label="日期" width="180">
      </el-table-column>
      <el-table-column prop="name" label="姓名" width="180">
      </el-table-column>
      <el-table-column prop="address" label="地址">
      </el-table-column>
    </el-table>

    <Pagination :total="total" :page-size="pageSize"></Pagination>


    <ParamsDialog ref="dialog"></ParamsDialog>
  </div>
</template>

<script>
import Pagination from '@/components/Pagination.vue'
import ParamsDialog from './ParamsDialog.vue';
export default {
  components: {
    Pagination,
    ParamsDialog
  },
  data() {
    return {
      search: '',
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }],
      total:10,
      pageSize:1
    }
  },
  methods: {
    showParams(){
      this.$refs.dialog.dialogVisible = true
    }
  }
}
</script>

<style scoped lang="less">
.params {
  margin: 10px;
}

.nav {
  padding: 10px;
}

.header {
  display: flex;
  background: #fff;
  padding: 10px;
  border: 1px solid #eee;

  button {
    margin-left: 20px;
  }
}

.my-table {
  margin: 10px auto;
}
</style>
